# test 1 -- 4x4 PBC Heisenberg model with 2x2 real correlators and the marshal sign rule guess
#           using steepest descent
echo -n "running test 1 ... ";
mpirun -np 2 ../bin/pcps.exe test_1_input.txt > test_1_output.txt;
if [ `grep "energy   " test_1_output.txt | tail -n 1 | sed -e "s/energy  *\(.......\).*/\1/"` == "-11.105" ]; then
  echo "passed";
else
  echo "failed";
fi;

# test 2 -- 1x10 OBC Hubbard model u/t = 4 with 2x1 complex correlators and a random pairing matrix guess
#           using stochastic reconfiguration
echo -n "running test 2 ... ";
mpirun -np 3 ../bin/pcps.exe test_2_input.txt > test_2_output.txt;
if [ `grep "energy   " test_2_output.txt | tail -n 1 | sed -e "s/energy  *\(....\).*/\1/"` == "-5.2" ]; then
  echo "passed";
else
  echo "failed";
fi;

# test 3 -- 6x6 PBC Triangular Heisenberg model with random complex triangle correlators using imaginary time evolution
echo -n "running test 3 ... ";
mpirun -np 8 ../bin/pcps.exe test_3_input.txt > test_3_output.txt;
if [ `grep "energy   " test_3_output.txt | tail -n 1 | sed -e "s/energy  *\(.......\).*/\1/"` == "-18.623" ]; then
  echo "passed";
else
  echo "failed";
fi;

# test 4 -- 1x10 OBC Hubbard model half filling u/t = 1 with 2x1 real correlators, fixed RHF reference, and projected optimization
echo -n "running test 4 ... ";
mpirun -np 8 ../bin/pcps.exe test_4_input.txt > test_4_output.txt;
if [ `grep "energy" test_4_output.txt | tail -n 1 | sed -e "s/.*energy = *\(..........\).*/\1/"` == "-9.7511707" ]; then
  echo "passed";
else
  echo "failed";
fi;
